/*
 * @Author: szx
 * @Date: 2022-07-20 15:21:23
 * @LastEditTime: 2022-07-20 15:50:21
 * @Description:
 * @FilePath: \leetcode\1200-1299\1260\1260.js
 */
/**
 * @param {number[][]} grid
 * @param {number} k
 * @return {number[][]}
 */
var shiftGrid = function (grid, k) {
    const m = grid.length,
        n = grid[0].length;
    const arr = [];
    for (let a of grid) {
        for (let b of a) arr.push(b);
    }

    for (let i = 0; i < m; i++) {
        for (let j = 0; j < n; j++) {
            grid[i][j] = one[(i * n + j + k) % (m * n)];
        }
    }
    return grid;
};
